package com.itheima.health.dao;

import com.itheima.health.pojo.CheckGroupItem;
import com.itheima.health.pojo.SetmealCheckGroup;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SetmealCheckGroupDao {

    /**
     * 检查组删除(根据中间表删除id)
     * @param id
     */
    void deleteByCheckgroupId(Integer id);


    //检查组 用项组表格查询 id
    List<CheckGroupItem> getByCheckgroupId(Integer id);



    @Insert("insert into setmeal_checkgroup(checkgroup_id, setmeal_id, code, name, remark) VALUES" +
            " (#{checkgroupId},#{setmealId},#{code},#{name},#{remark})")
    void insert(SetmealCheckGroup setmealCheckGroup);


    /**
     * 通过套餐id查询检查组
     * @param id
     * @return
     */
    List<SetmealCheckGroup> findGroupsBySetmealId(Integer id);
}